package com.designpattern.creatorpattern.factorypattern.factory_method;

/**
 * @author Administration
 * @date 2021/10/13 - 11:10 - 星期三
 * @project lambda
 * @package com.designpattern.factorypattern.factory_method
 * @by 晨
 */
public class CoffeeStore {
    private CoffeeFactory factory;

    public void setFactory(CoffeeFactory factory) {
        this.factory = factory;
    }


    public Coffee orderCoffee() {
        Coffee coffee = factory.createCoffee();
        coffee.addMilk();
        coffee.addsugar();
        return coffee;
    }
}
